package com.tarry.chain;

import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

@Slf4j
public class CommonManager extends Manager {


    public CommonManager(String name) {
        super.name = name;
    }

    @Override
    void handle(Request request) {

        if (Objects.equals("请假", request.getRequestType()) && request.getNumber() <= 2) {
            log.info("{} : {} 数量：{} 审批通过", name, request.getRequestContent(), request.getNumber());
        } else {
            // 下一责任人处理
            if (Objects.nonNull(superior)) {
                superior.handle(request);
            }
        }

    }
}
